package com.wx.forum.common;

public enum ResultCode {
    SUCCESS                 (0, "操作成功"),
    FAILED                  (1001, "操作失败"),
    FAILED_UNAUTHORIZED     (1002, "未授权"),
    FAILED_PARAMS_VALIDATE  (1003, "参数校验失败"),
    FAILED_FORBIDDEN              (1004, "禁⽌访问"),
    FAILED_CREATE                 (1005, "新增失败"),
    FAILED_NOT_EXISTS             (1101, "资源不存在"),
    FAILED_USER_EXISTS            (1102, "⽤户已存在"),
    FAILED_USER_NOT_EXISTS        (1103, "⽤户不存在"),
    FAILED_LOGIN                  (1104, "用户名或密码错误"),
    FAILED_USER_BANNED            (1105, "您已被禁⾔,请联系管理员,并重新登录."),
    FAILED_USER_COUNT             (1106,"用户帖子数量增加出错"),
    //电话号码不是11位
    FAILED_PhoneNum_NOT_11        (1107,"电话号码需要是11位"),
    FAILED_PASSWORD               (1109,"密码错误"),
    FAILED_PASSWORD_EQUAL         (1110,"新密码不能和老密码一致"),
    //板块错错误
    FAILED_BOARD_COUNT            (1201,"板块帖子数量增加出错"),
    FAILED_BOARD_NOT_EXISTS       (1202,"板块不存在"),
    FAILED_MESSAGE_NOT_EXISTS     (1301,"站内信不存在"),
    FAILED_TWO_PWD_NOT_S          (1000, "两次输⼊的密码不⼀致"),
    ERROR_SERVICES                (2000, "服务器内部错误"),
    ERROR_IS_NULL                 (2001, "IS NULL.");
    int code;
    String message;

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "ResultCode{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
